package zhr.chapter8;

public class Student {
    private String _stuNo;
    private String _stuName;
    private int _stuAge;
    private static int _STUNumber = 0;

    public Student() {
        _STUNumber++;
        if (_STUNumber < 10) {
            _stuNo = "1001100" + String.valueOf(_STUNumber);
        } else {
            _stuNo = "100110" + String.valueOf(_STUNumber);
        }
    }

    public Student(String stuName, int stuAge) {
        _STUNumber++;
        if (_STUNumber < 10) {
            _stuNo = "1001100" + String.valueOf(_STUNumber);
        } else {
            _stuNo = "100110" + String.valueOf(_STUNumber);
        }
        _stuName = stuName;
        _stuAge = stuAge;
    }

    public void setStuName(String name) {
        _stuName = name;
    }

    public void setStuAge(int age) {
        _stuAge = age;
    }

    public String printStuInfo() {
        String output = _stuNo + "," + _stuName + "," + String.valueOf(_stuAge);
        return output;
    }
}
